<template>
	<view class="recordDet">
		<!-- 公司名字 -->
		<view class="det_one">
			<view class="company_detail">
				<image :src="serviceDetail.coverImg" class="tupian"></image>
				<view class="price">
					<view>
						<text class="cu" v-if="serviceDetail.activityFlag == 1">促</text>
						<text class="company_name">{{serviceDetail.serviceTitle}}</text>
					</view>
					<view class="pri">￥{{serviceDetail.price}}</view>
				</view>
			</view>
		</view>
		<!-- empty -->
		<view class="empty"></view>
		<!-- contcat -->
		<view class="box">
			<view class="contact">
				<text>联系方式</text>
				<text class="tel">{{serviceDetail.contactNumber}}</text>
			</view>
		</view>
		<view class="content" v-if="serviceDetail.type == '服务留言'">
			<view class="tit">咨询内容</view>
			<view class="cont">
				{{serviceDetail.content}}
			</view>
		</view>
		<view class="empty"></view>
		<view class="jindu">
			<view class="title">
				<image src="../../static/first/zs.png"></image>
				<view>处理进度</view>
			</view>
			<!-- jindutiao -->
			<view class="pro">
				<view class="show_pro" v-for="(item,index) in process" :key="index">
					<view class="line_cir">
						<view class="cir_img">

						</view>
						<view class="line" v-if="index < process.length-1"></view>
					</view>
					<view class="da">
						<view>{{item.schedule}}</view>
						<view class="sj">
							{{item.updateTime}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				process: [],
				serviceDetail: {
					coverImg: '',
					activityFlag: '',
					serviceTitle: '',
					price: '',
					contactNumber: '',
					type: '',
					content: ''
				}
			}
		},
		onLoad(op) {
			let data = JSON.parse(decodeURIComponent(op.op))
			this.serviceDetail.coverImg = data.coverImg
			this.serviceDetail.activityFlag = data.activityFlag
			this.serviceDetail.serviceTitle = data.serviceTitle
			this.serviceDetail.price = data.price
			this.serviceDetail.contactNumber = data.contactNumber
			this.serviceDetail.type = data.type
			this.serviceDetail.content = data.content
			this.getScheduleByOrderId(data.id)
		},
		methods: {
			//根据订单id查询订单的进度
			getScheduleByOrderId(orderId) {
				uni.request({
					url: this.$serverUrl + 'ftOrder/getOrderScheduls/' + orderId,
					success: (res) => {
						this.process = res.data
					},
					fail: (e) => {
						uni.showToast({
							title: '进度获取失败',
							icon: 'none'
						})
					}
				})
			}
		}
	}
</script>

<style>
	.line_cir {
		width: 36upx;

	}

	.line {
		width: 1px;
		height: 114upx;
		border-left: 1px dotted #cccccccc;
		margin-left: 50%;
	}

	.det_one {
		margin: 36upx;
	}

	.company_detail {
		height: 194upx;
		/* border-bottom: 1px solid #EEEEEE; */
		display: flex;
		align-items: center;
	}

	.tupian {
		width: 212upx;
		height: 142upx;
		border-radius: 10upx;
		background-color: #666666;
	}

	.price {
		margin-left: 26upx;

	}

	.cu {
		width: 44upx;
		height: 44upx;
		background-color: #F87935;
		border-radius: 4upx;
		display: inline-block;
		font-size: 26upx;
		line-height: 44upx;
		text-align: center;
		color: #FFFFFF;
	}

	.company_name {
		font-size: 34upx;
		letter-spacing: 3upx;
		margin-left: 10upx;
	}

	.pri {
		font-size: 26upx;
		color: #DE3232;
		font-weight: bold;
		margin-top: 28upx;
	}

	.empty {
		height: 18upx;
		background-color: #F5F5F5;
	}

	/* 联系方式 */
	.box {
		margin: 0 36upx;
	}

	.contact {
		height: 124upx;
		border-bottom: 2px solid #F5F5F5;
		display: flex;
		align-items: center;
	}

	.tel {
		margin-left: 52upx;
	}

	.content {
		height: 364upx;
		margin: 0upx 36upx;
	}

	.tit {
		height: 124upx;
		display: flex;
		align-items: center;
	}

	.cont {
		font-size: 30upx;
		color: #666666;
	}

	.jindu {
		margin: 36upx;
	}

	.title {
		display: flex;
		align-items: center;
	}

	.title image {
		width: 22upx;
		height: 26upx;
	}

	.title view {
		font-weight: 600;
		margin-left: 30upx;
	}

	.pro {
		margin-top: 36upx;
		margin-bottom: 36upx;
	}

	.cir_img {
		width: 36upx;
		height: 36upx;
		background-color: #EEEEEE;
		border-radius: 50%;
		display: flex;
		flex-direction: column;
	}

	.da {
		font-size: 28upx;
		margin-left: 52upx;
	}

	.sj {
		color: #999999;
		font-size: 26upx;
		margin-top: 14upx;
	}

	.show_pro {
		display: flex;
		height: 150upx;
	}
</style>
